/* Integration points (quadratures)
   Jan Stebel
*/

#ifndef _LINEAR_H__
#define _LINEAR_H__

#include "intpoint.h"


/** Linear interpolation */
template<unsigned int dim>
class LinPoint : public IntPoint<dim>
{
protected:
	using IntPoint<dim>::imesh;

	bool isLinear() { return true; };

public:
	LinPoint() {};
	LinPoint(Mesh *mesh, const Quadrature<dim> *q) { IntPoint<dim>::init(mesh, q, dim+1); };
	void setGSF();
	void setSF();
	inline int getMeshNdof() { return imesh->getNlnodes(); }
};






/** Linear interpolation on quadratic mesh */
template<unsigned int dim>
class LinPointOnQuadMesh : public LinPoint<dim>
{
protected:
	using IntPoint<dim>::imesh;

public:
	LinPointOnQuadMesh(Mesh *mesh, const Quadrature<dim> *q) : LinPoint<dim>(mesh, q) {};
	inline int mapDof(int e, int n)
	{
		return ((QuadMesh *)imesh)->getNoOfLnode(IntPoint<dim>::mapDof(e, n));
	};
};








#endif
